import axios from "axios";

// export const fetchData = () => axios.get('/provience.json')

//获取省
export const fetchData = () =>
  axios
    .get("/provience.json")
    .then((res) => res.data.data.filter((item) => item.parentId === 0));

//获取市
export const fetchCity = (provienceId) =>
  axios
    .get("/provience.json")
    .then((res) =>
      res.data.data.filter((item) => item.parentId === provienceId)
    );

//获取县
export const fetchCounty = (cityId) =>
  axios
    .get("/provience.json")
    .then((res) => res.data.data.filter((item) => item.parentId === cityId));
